﻿<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3c.org/TR/1999/REC-html401-19991224/loose.dtd">
<HTML xmlns="http://www.w3.org/1999/xhtml">
<HEAD>
<META http-equiv=Content-Type content="text/html; charset=utf-8">
<TITLE> <? echo $title;?> </TITLE>
<base href="<?php echo base_url() ?>" />
<LINK href="images/default_1.css" type="text/css" rel=stylesheet>
<SCRIPT src="js/common.js" type="text/javascript"></SCRIPT>
<SCRIPT src="js/jquery.min.js" type="text/javascript"></SCRIPT>
<script src="js/jquery.form.js" type="text/javascript"></script>
<SCRIPT src="js/WebCalendar.js" type="text/javascript"></SCRIPT>
<SCRIPT type="text/javascript">
  function openWin(win){
        var url_="<?php echo site_url("main/orgselect"); ?>";
        window.open (url_,win, 'height=310, width=400, top=0, left=10, toolbar=no, menubar=no, scrollbars=yes, resizable=no,location=no, status=no')
    }
 function saveupdate(){
     var formdata=$("#myform").formSerialize();//对表单进行初如化
     var data_url= '<?php echo site_url("main/save_req_upadte") ?>';
     $('#msgs').html("<img src=\"images/loading.gif\" /><span class=\"about_content_title\"> 正在提交，请稍候。。。</span>");
     $(":input") .attr('disabled', true);
     $.ajax({  //调用Juqery Ajax
      type: "POST",
      url: data_url,
      data:formdata, //整个表单的数据
      timeout: 60000,//1分钟
      error: function(msgs){
          $('#msgs').html("<img src=\"images/error.gif\" /><span class=\"about_content_title\">更新超时，请重新提交！</span>");
          $(":input") .attr('disabled', false);
      },//error
      success: function(msg){
            $('#msgs').html("<img src=\"images/ok.gif\" /><span class=\"about_content_title\">"+msg+"</span>");
            $(":input") .attr('disabled', false);
      }//succesful
});//end ajax
 }

<!--
$(function(){
    $("#tr1").hide();   $("#tr2").hide();
    $("#mainsend").change(function(){
      vl=$("#mainsend").val();
      $("#att").val(vl);
    });
});
-->
</SCRIPT>
<script type="text/javascript">
function setCaret(textObj){
  if(textObj.createTextRange){
    textObj.caretPos=document.selection.createRange().duplicate();
  }
}
function insertAtCaret(textObj,textFeildValue){
  if(document.all&&textObj.createTextRange&&textObj.caretPos){
      var caretPos=textObj.caretPos;
      caretPos.text=caretPos.text.charAt(caretPos.text.length-1)==''?textFeildValue+'':textFeildValue;
  }else if(textObj.setSelectionRange){
      var rangeStart=textObj.selectionStart;
      var rangeEnd=textObj.selectionEnd;
      var tempStr1=textObj.value.substring(0,rangeStart);
      var tempStr2=textObj.value.substring(rangeEnd);
      textObj.value=tempStr1+textFeildValue+tempStr2;
      textObj.focus();
      var len=textFeildValue.length;
      textObj.setSelectionRange(rangeStart+len,rangeStart+len);
      textObj.blur();
  }else {
    textObj.value+=textFeildValue;
  }
}
$(document).ready(function(){
   if($.browser.msie){
     $("#router")
       .click(function(){
         setCaret($(this).get(0));
       })
       .select(function(){
         setCaret($(this).get(0));
       })
       .keyup(function(){
         setCaret($(this).get(0));
       });
   }

 });
</script>
</HEAD>
<BODY topMargin=10>
<TABLE cellSpacing=6 cellPadding=2 width="100%" border=0>
  <TBODY>
  <TR>
    <TD>
      <TABLE class=guide cellSpacing=0 cellPadding=0 width="100%" border=0>
        <TBODY>
        <TR>
          <TD><A href="<?php echo site_url("admin/info"); ?>" target="main">系统首页</A>&nbsp;» <? if(isset($type)){echo $type["type"];} ?></TD>
        </TR></TBODY></TABLE>
      <BR>
       <FORM id="myform" name="myform" method="post" ONSUBMIT="return setreqid();" ACTION="<?php echo site_url("main/doreq") ?>">
        <table class="tableborder" width="100%" border="0" cellspacing="0" cellpadding="0">
        <tr class="header">
          <td colspan="2"><? if(isset($type)){echo $type["type"];} ?>
          <input type="hidden" name="type_id" id="type_id" value="<? if(isset($type)){echo $type["type_id"];} ?>">
          <input type="hidden" name="type_dspt" id="type_dspt" value="<? if(isset($type)){echo $type["description"];} ?>">
          <input type="hidden" name="state" id="state" value="<? if(isset($req)){echo $req["state"];} ?>"><!--目前调单状态-->
          <input type="hidden" name="id" id="id" value="<?if(isset($req)){echo $req["id"];} ?>"><!--id-->
          <input type="hidden" name="req_id" id="req_id" value="<?if(isset($req)){echo $req["Requisition_ID"];} ?>"><!--调单号-->
          <input type="hidden" name="org1_id" id="org1_id" value="<?if(isset($req)){echo $req["org1_id"];} ?>"><!--一级机构的ID-->
          <input type="hidden" name="user_login" id="user_login" value="<?if(isset($req)){echo $req["us_login"];} ?>">
          <input type="hidden" name="mon" id="mon" value="<?if(isset($req)){echo $req["Req_Mon"];} ?>"><!--按月归档-->
          </td>
        </tr>
        <tr class="altbg1">
          <td width="100" >调单号：            </td>
          <td > <div style="margin-top:12px;margin-bottom:10px;color: #FF0000;font-weight: bold;font-size: 13px;"><a href="<?if(isset($req)){echo site_url("main/download"."/".$req["id"]);}?>"target="" ><?if(isset($req)){echo $req["Requisition_ID"];}?></a>
          </div></td>
        </tr>
        <tr>
          <td width="100">拟稿人：            </td>
          <td>  <input type="text" name="draft" id="draft"size="35" readonly value="<?if(isset($req)){echo $req["Draft"];}?>"></td>
        </tr>
        <tr>
         <td width="100">联系方式：            </td>
          <td>  <input type="text" name="tel" id="tel"size="35" value="<? if(isset($req)){echo $req["Tel"];}?>"></td>
        </tr>
          <tr>
         <td width="100">基站号：            </td>
          <td>  <input type="text" name="cell_id" id="cell_id"size="45" value="<? if(isset($req)){echo $req["Cell_ID"];}?>"></td>
        </tr>
        <tr>
          <td width="100">主送：            </td>
          <td ><input type="text" name="send" id="send" size="100"  value="<? if(isset($req)){echo $req["Main_Send"];}?>">
           <a  href="javascript:;"id="ch1" onclick="openWin('win1')" target=""><img src="images/ch.gif" border="0" title="选择主送部门"> </a>
           <a href="javascript:;"id="aBB" onclick="$('#tr1').show(); $(this).hide(); $('#to1').focus();" target=""><img src="images/s1.gif" border="0" title="显示抄送"> </a>
           <a href="javascript:;"id="aCC" onclick="$('#tr2').show(); $(this).hide(); $('#to2').focus();" target=""><img src="images/s2.gif" border="0" title="显示抄报"> </a>
          </td>
        </tr>
        <tr id="tr1" class="altbg1">
          <td width="100">抄送：            </td>
          <td><input type="text" name="to1" id="to1"size="100"value="<? if(isset($req)){echo $req["To_1"];}?>">
            <a  href="javascript:;"id="ch2" onclick="openWin('win2')" target=""><img src="images/ch.gif" border="0" title="选择抄送部门"> </a>
            <a href="javascript:;"id="aCC1" onclick="$('#tr1').hide();$('#aBB').show(); $('#to1').val('');" target=""><img src="images/h1.gif" border="0" title="删除抄送"></a>
          </td>
        </tr>
        <tr id="tr2" class="altbg1">
          <td width="100" >抄报：            </td>
          <td  ><input type="text"  name="to2" id="to2"size="100"value="<? if(isset($req)){echo $req["To_2"];}?>">
             <a  href="javascript:;"id="ch3" onclick="openWin('win3')" target=""><img src="images/ch.gif" border="0" title="选择抄报部门"> </a>
              <a href="javascript:;"id="aCC1" onclick="$('#tr2').hide();$('#aCC').show();  $('#to2').val('');" target=""><img src="images/h1.gif" border="0" title="删除抄报"></a>
          </td>
        </tr>
        <tr>
          <td width="100">主 调：            </td>
           <td><input type="text" name="mainsend" id="mainsend"size="100"value="<? if(isset($req)){echo $req["Main_attemper"];}?>">
            <a  href="javascript:;"id="ch4" onclick="openWin('win4')" target=""><img src="images/ch.gif" border="0" title="选择主调部门"> </a>
           </td>
        </tr>
        <tr>
          <td>使用部门：            </td>
           <td><input type="text" name="att" id="att"size="100" value="<? if(isset($req)){echo $req["Main_attemper"];}?>"readonly></td>
        </tr>
        <tr>
         <td>事 由：            </td>
           <td> <textarea name="cause" cols="102" rows="3" id="cause"><? if(isset($req)){echo $req["Cause"];}?></textarea></td>
        </tr>
        <tr>
          <td>调度内容：            </td>
           <td><textarea name="text" cols="102" rows="5" id="text"><? if(isset($req)){echo $req["Main_Content"];}else{echo "请机房配合相关分公司做好电路调度，并做好相关电路资料."; }?></textarea></td>
        </tr>
        <tr>
          <td width="100">通知时间 ：          </td>
          <td><input type="text" name="d1" id="d1" size="30" value="<? if(isset($req)){echo $req["Notify_Time"];}?>" onClick="return SelectDate(this,'yyyy-MM-dd');" readonly >  </td>
       </tr>
         <tr>
         <td width="100"> 要求完成时间 ：           </td>
          <td><input type="text" name="d2" id="d2"size="30" value="<? if(isset($req)){echo $req["Complete_Time"];}?>"onClick="return SelectDate(this,'yyyy-MM-dd');"readonly>  </td>
        </tr>
        <tr>
          <td>联系人：            </td>
           <td><textarea name="linkman" cols="102" rows="5" id="linkman"><? if(isset($req)){echo $req["linkman"];}?></textarea></td>
        </tr>
        <tr>
          <td>路由：            </td>
            <td>
            <div>
             <span id="span1" style="float:left;"><textarea name="router" cols="102" rows="15" id="router"><? if(isset($req)){echo $req["Router"];}?></textarea></span>
             <span id="span2" style="float:left;border:#999 1px solid;background-color:#FFFFCC;margin-left:15px;padding-right:50px;margin-top:40px;">
              <img class="" src="images/list.gif"  border="0"width="10" height="9" alt="list"/>&nbsp;&nbsp; <a href="javascript:insertAtCaret($('#router').get(0),'--自建SDH--')"id="sdh" style="margin-top:12px;margin-bottom:10px;color: #000000;font-weight: bold;font-size: 13px;">自建SDH</a><br>
              <img src="images/list.gif"  border="0" width="10" height="9" alt="list"/>&nbsp;&nbsp; <a  href="javascript:insertAtCaret($('#router').get(0),'--自建PDH--')" style="margin-top:12px;margin-bottom:10px;color: #FF0000;font-weight: bold;font-size: 13px;">自建PDH</a><br>
              <img src="images/list.gif"  border="0" width="10" height="9" alt="list"/> &nbsp;&nbsp;<a  href="javascript:insertAtCaret($('#router').get(0),'--自建微波--')" style="margin-top:12px;margin-bottom:10px;color: #0033CC;font-weight: bold;font-size: 13px;">自建微波</a><br>
              <img src="images/list.gif"  border="0" width="10" height="9" alt="list"/>&nbsp;&nbsp; <a  href="javascript:insertAtCaret($('#router').get(0),'--租用电信--')" style="margin-top:12px;margin-bottom:10px;color: #00CC00;font-weight: bold;font-size: 13px;">租用电信</a><br>
              <img src="images/list.gif"  border="0" width="10" height="9" alt="list"/>&nbsp;&nbsp; <a  href="javascript:insertAtCaret($('#router').get(0),'--2M线--')" style="margin-top:12px;margin-bottom:10px;color: #000000;font-weight: bold;font-size: 13px;">2M线</a><br>
              <img src="images/list.gif"  border="0" width="10" height="9" alt="list"/>&nbsp;&nbsp; <a  href="javascript:insertAtCaret($('#router').get(0),'<-->')" style="margin-top:12px;margin-bottom:10px;color: #FF0000;font-weight: bold;font-size: 13px;">端口对应</a><br>
              <img src="images/list.gif"  border="0" width="10" height="9" alt="list"/>&nbsp;&nbsp; <a  href="javascript:insertAtCaret($('#router').get(0),'--串--')" style="margin-top:12px;margin-bottom:10px;color: #FF0000;font-weight: bold;font-size: 13px;">串站</a><br>
              <img src="images/list.gif" border="0"  width="10" height="9" alt="list"/>&nbsp;&nbsp; <a  href="javascript:insertAtCaret($('#router').get(0),'--其它--')" style="margin-top:12px;margin-bottom:10px;color: #9966FF;font-weight: bold;font-size: 13px;">其它</a><br>
            </span>
            </div>
            </td>
        </tr>
          <tr>
          <td>&nbsp;</td>
          <td>
             <div align="left">
             <input id="checkbox" name="checkbox" type="checkbox" value="1" checked>
            同时发送邮件通知</div>
          </td>
        </tr>
        <tr>
          <td>&nbsp;</td>
          <td>
             <input class="submit" type="button" value="提交更新" name=s1 id="s1" onClick="saveupdate()">
             <input id="reset" type="reset" value="重置表单" name="reset" onclick="  $('#draft').focus();">
          </td>
        </tr>
        <tr>
          <td></td>
          <td >
          <div id="msgs" style="margin-top:12px;margin-bottom:5px;font-size:13px;color: #C62E25;font-weight:bold;"></div>
          </td>
       </tr>
      </table>
      </FORM>
      </TD></TR></TBODY></TABLE><BR><BR>
      <br/><br/>
      <DIV class=footer>
        <HR width="80%" color=#9db3c5 noShade SIZE=0>
         Powered by <? echo $copyright ?> <em>,</em> <B><A style="COLOR: #666" href="<? echo base_url() ?>" target="_blank"><? echo $version;?>.</A></B>
      </DIV>
</BODY>
</HTML>
